﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LAVAA.BL.Misc
{
    public static class Utils
    {
        public static void CopyPropertyValues(object source, object destination)
        {
            foreach (var sourceProperty in source.GetType().GetProperties())
            {
                var destProperty = destination.GetType().GetProperty(sourceProperty.Name);
                if (destProperty.PropertyType.IsAssignableFrom(sourceProperty.PropertyType))
                    destProperty.SetValue(destination, sourceProperty.GetValue(source, new object[] { }), new object[] { });
            }
        }
    }
}
